package com.fdb.efp.nls.service.common.rules;

import com.fdb.basic.framework.core.constant.EsbRetCodeStandard;
import com.fdb.basic.framework.core.exception.BizException;
import com.fdb.basic.framework.core.util.ValidationUtils;

/**
 * 需求编号:2019D08--
 * 问题编号:
 * 开发人员: caoxin
 * 创建日期:2019/12/4
 * 功能描述:
 * 修改日期:2019/12/4
 * 修改描述:
 */
public class PhoneRule implements CheckRule {
    private String mobile;

    public PhoneRule(String mobile) {
        this.mobile = mobile;
    }

    @Override
    public void check() throws BizException {
        boolean flag = ValidationUtils.validPhoneNum("0", mobile);
        if (!flag) {
            throw new BizException(EsbRetCodeStandard.KHXXJYBTG.getValue(), "手机号码格式错误");
        }
    }
}
